<html>
<head>
	<script>
	var grid;
	var dialog;
		function add(id)
        {
        	var url =  contextUrl+'/opt/base/db/savePage.do';
        	if(typeof id ==='string'){
        		url+="?id="+id;
        		}
           dialog =  $.ligerDialog.open({ 
	            url:url,
	            height: 500,width: 800  
               });
        }
         
        function del(id)
        {
            if(confirm("确定删除记录吗?")){
            	$.post(contextUrl+'/opt/base/db/del.ajax',{id:id},function(data){
            	
            		alert(data.message);
            		location.reload();
            	});
            }
        }
        
		$(function(){
			grid = $.jifsu.grid.init("#dbListTable",{
                height:'100%',
                url:contextUrl+"/opt/base/db/listData.ajax",
                columns: [
                { display: '', name: 'DBID', align: 'left',width:.0001,frozen:true },
                { display: '配置说明', name: 'DESCR', align: 'left', width: 200, minWidth: 60 },
                { display: '驱动类', name: 'DRIVERNAME',  width: 200 },
                { display: 'jdbc连接地址', name: 'JDBCURL', width: 200},
                { display: '用户名', name: 'USERNAME' , width: 200},
                 { display: '密码', name: 'PASSWD' , width: 100},
                  { display: '操作', name: '', width: 100, render:function(row){
                  		return "<a href='javascript:;' onclick='add(\""+ row.DBID +"\")'>修改</a>&nbsp;|&nbsp;<a href='javascript:;' onclick='del(\""+ row.DBID +"\")'>删除</a>";
                 	 
                  }
                 }
                ],   
                toolbar: { items: [
                { text: '增加', click: add, icon: 'add' }  
                ]
                }
            });
		
		
		
		});
	
	</script>
</head>
<body>
<div>
	
	<div id="dbListTable"></div>
</div>
</body>
</html>